package com.cnap.multiclouldmgmt.model.k8sModels;

import com.cnap.multiclouldmgmt.model.K8sClusterInfoModel;
import com.cnap.multiclouldmgmt.util.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
/**
 * 集群组件基础信息
 * @author dyq
 */
@ApiModel(value = "com.cnap.multiclouldmgmt.model.k8sModels.NameSpaceModel",description = "命名空间信息")
public class NameSpaceModel extends K8sClusterInfoModel {

    //nameSpace名称
    @ApiModelProperty(value = "nameSpace名称")
    private String nameSpaceName;

    //nameSpace描述
    @ApiModelProperty(value = "nameSpace描述")
    private String describe;

    //工作负载数
    @ApiModelProperty(value = "工作负载数")
    private int deploymentNum;

    //服务数
    @ApiModelProperty(value = "服务数")
    private int svcNum;

    //容器组数量
    @ApiModelProperty(value = "容器组数量")
    private int podNum;

    //cpu使用量，单位m，和核心数的换算为1*1000
    @ApiModelProperty(value = "cpu使用量，单位m，和核心数的换算为1*1000")
    private String cpuUse;

    //内存使用量，单位m
    @ApiModelProperty(value = "内存使用量，单位m")
    private String memUse;

    //创建时间
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    //创建时间格式化
    @ApiModelProperty(value = "创建时间格式化")
    private String createTimeStr;

    public String getCreateTimeStr() {

        if ((StringUtils.isEmpty(createTimeStr))
                &&(createTime != null)){
            createTimeStr = DateUtils.changeDateFormatYYYYMMDDHHMMSS(createTime);
        }

        return createTimeStr;
    }

    /**
     * get
     *
     * @return NameSpaceName
     */
    public String getNameSpaceName() {
        return nameSpaceName;
    }

    /**
     * set
     *
     * @param nameSpaceName nameSpaceName
     */
    public void setNameSpaceName(String nameSpaceName) {
        this.nameSpaceName = nameSpaceName;
    }

    /**
     * get
     *
     * @return Describe
     */
    public String getDescribe() {
        return describe;
    }

    /**
     * set
     *
     * @param describe describe
     */
    public void setDescribe(String describe) {
        this.describe = describe;
    }

    /**
     * get
     *
     * @return DeploymentNum
     */
    public int getDeploymentNum() {
        return deploymentNum;
    }

    /**
     * set
     *
     * @param deploymentNum deploymentNum
     */
    public void setDeploymentNum(int deploymentNum) {
        this.deploymentNum = deploymentNum;
    }

    /**
     * get
     *
     * @return SvcNum
     */
    public int getSvcNum() {
        return svcNum;
    }

    /**
     * set
     *
     * @param svcNum svcNum
     */
    public void setSvcNum(int svcNum) {
        this.svcNum = svcNum;
    }

    /**
     * get
     *
     * @return PodNum
     */
    public int getPodNum() {
        return podNum;
    }

    /**
     * set
     *
     * @param podNum podNum
     */
    public void setPodNum(int podNum) {
        this.podNum = podNum;
    }

    /**
     * get
     *
     * @return CpuUse
     */
    public String getCpuUse() {
        return cpuUse;
    }

    /**
     * set
     *
     * @param cpuUse cpuUse
     */
    public void setCpuUse(String cpuUse) {
        this.cpuUse = cpuUse;
    }

    /**
     * get
     *
     * @return MemUse
     */
    public String getMemUse() {
        return memUse;
    }

    /**
     * set
     *
     * @param memUse memUse
     */
    public void setMemUse(String memUse) {
        this.memUse = memUse;
    }

    /**
     * get
     *
     * @return CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * set
     *
     * @param createTime createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * set
     *
     * @param createTimeStr createTimeStr
     */
    public void setCreateTimeStr(String createTimeStr) {
        this.createTimeStr = createTimeStr;
    }
}
